package com.example.hotelsystem.controller.userrolepower;


import com.example.hotelsystem.entity.User;
import com.example.hotelsystem.entity.UserRole;
import com.example.hotelsystem.result.Result;
import com.example.hotelsystem.service.UserRoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Lee
 * @since 2020-10-13
 */
@RestController
@RequestMapping("/hotelsystem/UserRole")
@Api(tags = "用户角色控制器")
public class UserRoleController {

    @Autowired
    UserRoleService UserRoleService;

    @PostMapping("/change")
    @ApiOperation("更改用户角色,{传入用户ID和角色ID参数即可}")
    public Result ChangeUserRole(@RequestParam("user_id")Long userId,
                                 @RequestParam("role_id")Long roleId){
        return UserRoleService.ChangeUserRole(userId,roleId);
    }
}

